// pages/user/index.js
Page({
  data: {
    userinfo:{},
    // 收藏的商品
    collects:0
  },
  onShow: function () {
    const userinfo = wx.getStorageSync("userinfo");
    const collect = wx.getStorageSync("collect")||[]
    this.setData({
      userinfo,
      collects:collect.length
    })
  }
})